package com.chushouya.manager.constants;


import com.general.framework.core.enums.IEnum;

import java.util.Objects;

/**
 * 阅读状态(0未读/1已读/2星标)
 */
public enum ReadStatusEnum implements IEnum<Integer> {

    unread(0, "未读"),
    read(  1, "已读"),
    star(  2, "星标")
    ;

    private Integer value;

    private String desc;

    ReadStatusEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getDesc(Integer value) {
        for (ReadStatusEnum thisEnum : ReadStatusEnum.values()) {
            if (Objects.equals(thisEnum.value, value)) {
                return thisEnum.desc;
            }
        }
        return "";
    }

    @Override
    public Integer value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }
}
